import request from '@/utils/request'

export function areaListData(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/area/list`,
    method: 'post',
    data: query
  })
}

export function areaTreeData(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/area/treeData`,
    method: 'post',
    data: query
  })
}

export function wareList(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/info/list`,
    method: 'post',
    data: query
  })
}

export function wareTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/info/table`,
    method: 'post',
    data: query
  })
}

export function wareLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/info/load`,
    method: 'get',
    params: query
  })
}

export function wareSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/info/save`,
    method: 'post',
    data: query
  })
}

export function wareDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/info/delete`,
    method: 'post',
    data: query
  })
}

export function wareSkuTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/sku/table`,
    method: 'post',
    data: query
  })
}

export function wareSkuLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/sku/load`,
    method: 'get',
    params: query
  })
}

export function wareSkuSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/sku/save`,
    method: 'post',
    data: query
  })
}

export function wareSkuDelete(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/ware/sku/delete/${id}`,
    method: 'post'
  })
}
